package com.cleaningcloud.cld.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.cleaningcloud.cld.domain.dto.CldRegularMeetingDto;
import com.cleaningcloud.cld.domain.vo.CldRegularMeetingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cleaningcloud.common.log.annotation.Log;
import com.cleaningcloud.common.log.enums.BusinessType;
import com.cleaningcloud.common.security.annotation.RequiresPermissions;
import com.cleaningcloud.cld.domain.CldRegularMeeting;
import com.cleaningcloud.cld.service.ICldRegularMeetingService;
import com.cleaningcloud.common.core.web.controller.BaseController;
import com.cleaningcloud.common.core.web.domain.AjaxResult;
import com.cleaningcloud.common.core.utils.poi.ExcelUtil;
import com.cleaningcloud.common.core.web.page.TableDataInfo;

/**
 * 例会管理Controller
 * 
 * @author cleaningcloud
 * @date 2025-01-13
 */
@RestController
@RequestMapping("/regularMeeting")
public class CldRegularMeetingController extends BaseController
{
    @Autowired
    private ICldRegularMeetingService cldRegularMeetingService;

    /**
     * 查询例会管理列表
     */
    @RequiresPermissions("cld:regularMeeting:list")
    @GetMapping("/list")
    public TableDataInfo list(CldRegularMeeting cldRegularMeeting)
    {
        startPage();
        List<CldRegularMeetingVo> list = cldRegularMeetingService.selectCldRegularMeetingList(cldRegularMeeting);
        return getDataTable(list);
    }


    /**
     * 获取例会管理详细信息
     */
    @RequiresPermissions("cld:regularMeeting:query")
    @GetMapping(value = "/{regularMeetingId}")
    public AjaxResult getInfo(@PathVariable("regularMeetingId") Long regularMeetingId)
    {
        return success(cldRegularMeetingService.selectCldRegularMeetingByRegularMeetingId(regularMeetingId));
    }

    /**
     * 新增例会管理
     */
    @RequiresPermissions("cld:regularMeeting:add")
    @Log(title = "例会管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody CldRegularMeetingDto cldRegularMeeting)
    {
        return toAjax(cldRegularMeetingService.insertCldRegularMeeting(cldRegularMeeting));
    }

    /**
     * 修改例会管理
     */
    @RequiresPermissions("cld:regularMeeting:edit")
    @Log(title = "例会管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody CldRegularMeeting cldRegularMeeting)
    {
        return toAjax(cldRegularMeetingService.updateCldRegularMeeting(cldRegularMeeting));
    }

    /**
     * 删除例会管理
     */
    @RequiresPermissions("cld:regularMeeting:remove")
    @Log(title = "例会管理", businessType = BusinessType.DELETE)
	@DeleteMapping("/{regularMeetingIds}")
    public AjaxResult remove(@PathVariable Long[] regularMeetingIds)
    {
        return toAjax(cldRegularMeetingService.deleteCldRegularMeetingByRegularMeetingIds(regularMeetingIds));
    }
}
